package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Controller
//@RestController 在用json做数据传输时可以用该注解
public class HelloController {

    @RequestMapping("hello")
    public String hello(Model model){
        model.addAttribute("model","HelloControllerAnn");
        return "/hello";
    }
}
